import React from 'react';

class ProfilePage extends React.Component {

  state={
    time: ''
  }

  componentDidMount() {
    setInterval(() => {
      // 获取当前系统时间
      const currentTime = new Date( +new Date() + 8 * 3600 * 1000 ).toJSON().slice(0,19).replace("T"," ")
      // 将系统时间赋值给state
      this.setState({
        time: currentTime
      })
    },1000)
  }

  render() {
    return <div>{this.state.time}</div>;
  }
}

export default ProfilePage;
